All Questions
6 questions
3votes
1answer
12kviews
how is stack and heap are assigned to each processes?
How multiples processes are stored in the main memory , i understand every process will be divided into the equal size pages and will be stored in the frames of main memory. if whole main memory is ...
6votes
4answers
765views
How to convert the following node evaluation procedure to a non recursive solution?
I have the following recursive method. It evaluates a node (that represent a logical expression), using deep first search traversal : EvaluateNode(Node node) { bool result; switch(node.Type) ...
2votes
1answer
379views
How to efficiently sort a recursively defined Stack?
I am trying to implement a recursively defined Stack and sort it in Java. I don't have a particular usage of this program in mind. I found this approach of stack implementation a bit useful while ...
14votes
4answers
3kviews
When there's no TCO, when to worry about blowing the stack?
Every single time there's a discussion about a new programming language targetting the JVM, there are inevitably people saying things like: "The JVM doesn't support tail-call optimization, so I ...
6votes
4answers
16kviews
Is there a way to display the stack during recursion method?
I'm trying to learn recursion. I copied this bit of code from my book and added the displays to help me trace what the method is doing and when. public static void main(String[] args) { ...
8votes
3answers
7kviews
Local Stack vs Call Stack
On the matter of Recursion: When you create a recursive function, you create a call stack. Ok, no problem; However, a comment on this page (look for comments by "LKM") triggered my curiosity (and ...